/**
 * 
 */
package de.mbenning.fsim.web;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.multiaction.MultiActionController;

import de.mbenning.fsim.domain.Land;
import de.mbenning.fsim.persistence.dao.interfaces.IMainDAO;
import de.mbenning.fsim.persistence.dao.interfaces.IVereinDAO;

/**
 * @author Martin.Benning
 *
 */
public class FrontController extends MultiActionController {
	
	private IMainDAO mainDAO;
	
	private IVereinDAO vereinDAO;

	public ModelAndView handleHome(HttpServletRequest request, HttpServletResponse response) throws ServletException {
        Map<String, Object> model = new HashMap<String, Object>();
        return new ModelAndView("homeView", model);
    }
	
	public ModelAndView handleLaenderList(HttpServletRequest request, HttpServletResponse response) throws ServletException {
        Map<String, Object> model = new HashMap<String, Object>();
        
        List<Land> laender = mainDAO.findAllLaender();
        model.put("laender", laender);
        
        return new ModelAndView("laenderListView", model);
    }
	
	public IMainDAO getMainDAO() {
		return mainDAO;
	}

	public void setMainDAO(IMainDAO mainDAO) {
		this.mainDAO = mainDAO;
	}

	public IVereinDAO getVereinDAO() {
		return vereinDAO;
	}

	public void setVereinDAO(IVereinDAO vereinDAO) {
		this.vereinDAO = vereinDAO;
	}

}
